package dmas.lab;

import java.util.List;

import dmas.lab.models.Contact;
import dmas.lab.models.Group;
import dmas.lab.schedulers.Event;
import dmas.lab.schedulers.Scheduler;
import dmas.lab.tasks.SendSpamTask;

public class Main {

	public static void main(String[] args) {
		Group group = populateGroup();
		
		Scheduler scheduler = new Scheduler();
		scheduler.addEvent(new Event(new SendSpamTask(group), scheduler));
	}

	private static Group populateGroup() {
		Group group = new Group("DMAS");
		List<Contact> readContacts = FileReader.readContacts();
		for (Contact contact : readContacts) {
			group.addMember(contact);
		}
		return group;
	}
}
